Skip to content

fix(shared): share the wrapped post when sharing a share post to a squad - #7392

Merged
idoshamun merged 1 commit into
mainfrom
fix/share-to-squad-unwrap-share
Nov 16, 2026
Merged

idoshamun merged 1 commit into
mainfrom
fix/share-to-squad-unwrap-share

Conversation

@idoshamun

@idoshamun idoshamun commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Problem

Sharing a share post that has no commentary to a squad opened the composer with the wrapper post itself: its own r/ link, "No title" and the placeholder cover, instead of the article it shares.

Root cause

All three share-to-squad entry points (DiscussionShareRow, ShareBar and the Share modal's SocialShare) seeded the SmartComposer with initialUrl: post.permalink and preview: post. The API already resolves a share without commentary to the post it wraps when sharing (determineSharedPostId), but the client never did. So the preview showed the empty wrapper, and the moderated-squad path sent the wrapper's id as sharedPostId. The pattern came over from the old CreateSharedPostModal when it was replaced by the SmartComposer in #6417.

Fix

  • Add getPostToShare in graphql/posts.ts, mirroring the API rule: a share post with no title and a sharedPost resolves to sharedPost; any other post resolves to itself.
  • Use it for the composer's initialUrl and preview at all three entry points. Log events still reference the original post.

Testing

  • Unit tests for getPostToShare.
  • Regression tests in DiscussionShareRow, ShareBar and ShareModal specs: the composer opens with the wrapped post's link and title. They fail on the previous code and pass with this change.
  • Lint, strict typecheck on changed files, the related shared specs and the webapp test suite all pass.
  • Checked manually against a local webapp: sharing a share without commentary to a squad now shows the original article's link, title and cover in the composer.

Reported internally.

@tsahimatsliah could you take a look? This touches the share-to-squad flow you moved onto the SmartComposer.

This PR was written by Smith (AI).

🤖 Generated with Claude Code

Written by Smith (AI).

Preview domain

https://fix-share-to-squad-unwrap-share.preview.app.daily.dev

Sharing a share post that has no commentary to a squad opened the composer
with the wrapper itself: its r/ link, "No title" and the placeholder cover.
All three share-to-squad entry points (DiscussionShareRow, ShareBar and the
Share modal) passed the post as is, a pattern carried over from the old
CreateSharedPostModal.

The API already unwraps such a post in sharePost (determineSharedPostId), so
mirror that rule on the client with getPostToShare and use it to seed the
composer's URL and preview. This also sends the wrapped post's id on the
moderated-squad path, which passes preview.id as sharedPostId.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-webapp Ready Ready Preview Nov 16, 2026 11:13am UTC
storybook Ready Ready Preview Nov 16, 2026 11:13am UTC

Request Review

@idoshamun
idoshamun merged commit 3c0ac77 into main Nov 16, 2026
13 checks passed
@idoshamun
idoshamun deleted the fix/share-to-squad-unwrap-share branch November 16, 2026 11:50

This branch was successfully deployed

2 active deployments
Preview – daily-webapp — aa659acc Deployed Nov 16, 2026 by vercel[bot]
Preview – storybook — aa659acc Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants